package com.Algorithm.HUAWEI.one20211020;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/10/20/17:41
 * @Description:
 * @Target:
 */
public class 四舍五入 {
    // 输入5.5  为6
    // 输入2.499 为2

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
//        double d = scanner.nextFloat();


        Trim(5.5);
        Trim(2.499 );


    }


    public static void Trim(double d){
        int i = (int)d;
        if((int)(d+0.5)==(i+1)){
            System.out.println(i+1);
        }else{
            System.out.println(i);
        }
    }


}
